import request from "@/components/axios/index";
interface Req {
    name: string;
    age: string;
    id: string;
}

// 查询
export const getList = (data: Partial<Req>) => {
    return request<any, any>({
        url: "users/list",
        method: "get",
        data,
    });
};
// 增加
export const addPeople = (data: Pick<Req, 'name' | 'age'>) => {
    return request<any, any>({
        url: "users/add",
        method: "post",
        data,
    });
};
// 修改
export const updatePeople = (data: Req) => {
    return request<any, any>({
        url: "users/update",
        method: "post",
        data,
    });
};
//删除
export const delPeople = (id: string) => {
    return request<any, any>({
        url: "users/del",
        method: "get",
        data: { id },
    });
};
